#ifndef _DIFFUSE_H_
#define _DIFFUSE_H_

#include "cg.h"

void normal(double buf[3], cgPoint *p1, cgPoint *p2, cgPoint *p3);
double dot_product(double *v1, double *v2);
double vec_mod(double *v);
double angle_theta(cgPoint *p1, cgPoint *p2, cgPoint *p3, double *light_dir);
double calc_diffuse_intens(
    cgPoint *p1, 
    cgPoint *p2, 
    cgPoint *p3, 
    double light_dir[3],
    double light_intens,
    double kd
    );

#endif
